package xyz.itpath.oss.aliyun.conf;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import xyz.itpath.config.OssProperties;

/**
 * @author zhaomengru
 * create by 2024/1/3 - 21:28
 */
@Configuration
public class AliOssConfig {

    @Bean
    public OSS ossClient(OssProperties properties) {
        return new OSSClientBuilder()
                .build(properties.getEndpoint(),
                        properties.getAccessKeyId(),
                        properties.getAccessKeySecret());
    }
}
